
using System;
using System.Collections.Generic;
using System.Text;
using System.Web;

namespace ScrewTurn.Wiki.PluginFramework {

	/// <summary>
	/// Contains information about the Context of the page formatting.
	/// </summary>
	public class ContextInformation {

		private PageInfo page;
		private string language;
		private HttpContext httpContext;
		private string username;
		private bool userIsAdmin;

		/// <summary>
		/// Initializes a new instance of the <b>FormatContext</b> class.
		/// </summary>
		/// <param name="page">The Page Information, if any, <b>null</b> otherwise.</param>
		/// <param name="language">The current Thread's language (for example "en-US").</param>
		/// <param name="httpContext">The current HTTP Context object.</param>
		/// <param name="username">The current User's Username (or <b>null</b>).</param>
		/// <param name="userIsAdmin">A value specifying whether or not the current User is an Administrator.</param>
		public ContextInformation(PageInfo page, string language, HttpContext httpContext, string username, bool userIsAdmin) {
			this.page = page;
			this.language = language;
			this.httpContext = httpContext;
			this.username = username;
			this.userIsAdmin = userIsAdmin;
		}

		/// <summary>
		/// Gets the Page Information.
		/// </summary>
		public PageInfo Page {
			get { return page; }
		}

		/// <summary>
		/// Gets the current Thread's Language (for example en-US).
		/// </summary>
		public string Language {
			get { return language; }
		}

		/// <summary>
		/// Gets the current HTTP Context object.
		/// </summary>
		public HttpContext HttpContext {
			get { return httpContext; }
		}

		/// <summary>
		/// Gets the Username of the current User (or <b>null</b>).
		/// </summary>
		/// <remarks>If the Username is not available, the return value is <b>null</b>.</remarks>
		public string Username {
			get { return username; }
		}

		/// <summary>
		/// Gets a value specifying whether or not the current User (if any) is an Administrator.
		/// </summary>
		public bool UserIsAdmin {
			get { return userIsAdmin; }
		}

	}

}
